package flc.ast.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.View;

import com.blankj.utilcode.util.ClipboardUtils;
import com.blankj.utilcode.util.ToastUtils;

import java.util.List;

import flc.ast.BaseAc;
import flc.ast.R;
import flc.ast.databinding.ActivityTextRecBinding;
import flc.ast.databinding.ActivityTextRecResBinding;
import stark.common.apis.base.ImgPlantRet;

public class TextRecResActivity extends BaseAc<ActivityTextRecResBinding> {

    public static Bitmap sBitmap;
    public static String sResult;

    @Override
    protected int onCreate() {
        return R.layout.activity_text_rec_res;
    }

    @Override
    protected void initView() {
        mDataBinding.ivTextRecResBack.setOnClickListener(v -> onBackPressed());
        mDataBinding.ivCopy.setOnClickListener(this);
    }

    @Override
    protected void onClickCallback(View v) {
        switch (v.getId()) {
            case R.id.ivCopy://复制
                ClipboardUtils.copyText(sResult);
                ToastUtils.showShort(R.string.have_copy);
                break;
        }
    }

    @Override
    protected void initData() {
        mDataBinding.tvDesc.setText(sResult);
        mDataBinding.ivTextRecResImg.setImageBitmap(sBitmap);
    }
}